/**
 * ReportGear(2011)
 */
package net.abbp.report.view.cell.editor;

import java.awt.FlowLayout;

import javax.swing.JToolBar;

import net.abbp.report.designer.action.IAction;

import com.reportgear.designer.action.edit.MergeCellAction;
import com.reportgear.designer.action.edit.UnmergeCellAction;
import com.reportgear.designer.action.style.GlobalStyleAction;

/**
 * 通用工具栏
 * 
 * @version 1.0 2011-3-24
 * @author <a herf="lexloo@gmail.com">lexloo</a>
 * @since Report 1.0
 */
public class SubReportToolBar extends JToolBar {

    public SubReportToolBar() {
        super();

        this.initialize();
    }

    private void initialize() {
        this.setRollover(true);
        this.setLayout(new FlowLayout(FlowLayout.LEFT, 1, 1));
//        this.addAction(new NewReportAction());
//        this.addAction(new SaveReportAction());
//        // this.addAction(new DeleteReportAction());
//        this.addAction(new OpenReportAction());
//        this.addSeparator();
//        this.addAction(new PagePreviewAction());
//        this.addAction(new PrintReportAction());
//        this.addAction(new PageSetupAction());
        this.addSeparator();
        this.addAction(new MergeCellAction());
        this.addAction(new UnmergeCellAction());
        this.addSeparator();
        this.addAction(new GlobalStyleAction());
//        this.addSeparator();
//        this.addAction(new CloseAction());
    }

    /**
     * 添加Action
     * 
     * @param action
     */
    private void addAction(IAction action) {
        this.add(action.createToolBarComponent());
    }
}
